from .chatglm_transltor import ChatglmTranslator
from .gpt_transltor import GptTranslator

"""
    翻译器工厂类，负责返回具体的翻译器
"""
class TranslatorFactory:
    def __init__(self):
        self.translators =[
            ChatglmTranslator(),
            GptTranslator()
        ]

    def get_translator(self, translator_name):
        for translator in self.translators:
            if translator_name == translator.name:
                return translator
        return self.translators[0]